package net.sky.oa.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 物品申请物品表
 * FloApplyGoods. @author hond
 */

@Entity
@Table(name = "FLO_APPLY_GOODS")//物品申请,物品表
public class FloApplyGoods implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private Integer amount;   //总数
	private String unit;    //单位
	private String desn;    //描述
	private FloGoods goods;//物品id
	private FloGoodsapply goodsapply;//物品申请id

	// Constructors

	/** default constructor */
	public FloApplyGoods() {
	}

	/** minimal constructor */
	public FloApplyGoods(Long id) {
		this.id = id;
	}
	
	@Id 
	@SequenceGenerator(name="SQ_FLOAPPLYGOODS_ID",sequenceName="SQ_FLOAPPLYGOODS_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_FLOAPPLYGOODS_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "AMOUNT", precision = 4, scale = 0)
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@Column(name = "UNIT", length = 10)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "DESN", length = 100)
	public String getDesn() {
		return this.desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GOODS_ID")
	public FloGoods getGoods() {
		return this.goods;
	}

	public void setGoods(FloGoods goods) {
		this.goods = goods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GOODSAPPLY_ID")
	public FloGoodsapply getGoodsapply() {
		return this.goodsapply;
	}

	public void setGoodsapply(FloGoodsapply goodsapply) {
		this.goodsapply = goodsapply;
	}

}